<template>
	<view class="kpp-order-page">
		<view class="kpp-order-msg">
			<view class="kpp-order-title">
				{{item.name | goodName}}
			</view>
			<view class="kpp-order-phone-tip">
				* 重要提醒：请输入报名手机号，老师优先安排排课！
			</view>
			<view class="kpp-order-phone-input">
				<view class="">
					<text>*</text>联系号码
				</view>
				<input type="text" v-model="telephone" placeholder="请输入联系手机号" />
			</view>
		</view>
		<view class="kpp-course-msg">
			所报名课程
		</view>
		<view class="kpp-course-person-msg" v-for="(item,index) in selectCourses" :key="index">
			<view class="kpp-course-person-msg-course">
				{{item.name|goodName_val}}
				<view class="" style="background: #FFE5E0;border-radius: 8px;height: 2upx; margin: 20upx 0upx;"></view>
				<view class="" style="font-size: 26upx;">
					<view class="" style="display: inline-block; margin-right: 80upx;">
						价格：¥{{item.price}}
					</view>
					<view class="" style="display: inline-block;">
						数量：{{item.quantity}}
					</view>
				</view>
			</view>
			<view class="write-enroll-msg-title">
				<view class=""></view>
				<view class="">
					填写报名信息
				</view>
			</view>
				<view class="kpp-order-phone-input" v-for="(info,inde) in courseDetail" :key="inde">
					<view class="">
						<text v-if="isNeed">*</text>{{info.name.name}}
					</view>
					<input type="text" v-model="info.value" :placeholder="'请输入'+ info.name.name"/>
				</view>
			<!-- </view> -->
			<!-- <view class="kpp-order-phone-input">
				<view class="">
					<text>*</text>孩子姓名
				</view>
				<input type="text" v-model="name" placeholder="请填写孩子姓名" />
			</view>
			<view class="kpp-order-phone-input">
				<view class="">
					<text>*</text>联系电话
				</view>
				<input type="text" v-model="name" placeholder="请填写联系电话" />
			</view>
			<view class="kpp-order-phone-input">
				<view class="">
					<text>*</text>孩子性别
				</view>
				<view class="account-selection" v-for="( ind,index ) in sexlist" :key="index" @click="checksex">
					<image :src="ind.choice ? opt : noopt" mode=""></image>
					<view >{{ind.sex}}</view>
				</view>
			</view> -->
			<view class="" style="background: #F2F2F2; height: 2upx; margin: 40upx 0upx 26upx 0upx;"></view>
			<view class="" style="font-size: 30upx; color: #333333; font-weight: bold;">
				小计：
				<view class="" style="display: inline-block;color: #E41D1D;">
					¥ {{item.price * item.quantity}}
				</view>
			</view>
		</view>

		<view class="kpp-order-footer">
			限时限量特惠项目，尽快抢名额。
		</view>
		<view class="" style="padding: 30upx; background-color: #ffffff;">
			<view class="" style="display: inline-block;font-size: 34upx; color: #333333; font-weight: bold;">
				合计：
				<view class="" style="display: inline-block;color: #E41D1D;">
					¥{{total.toFixed(2)}}
				</view>
			</view>
			<view class="immediate-payment" @click="handlePay">
				立即支付
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				appid:'',
				isNeed:false,
				store_id: 0,
				acOrderId:'',
				token: this.$store.getters.getToken,
				item: null,
				isGroup: '',
				priceType: '',
				group_type: '',
				buyMethod: '',
				telephone: '',
				selectCourses: [],
				buyCourses: [],
				giveCourses: [],
				courseDetail:[],
				buyTotal: 0,
				giveTotal: 0,
				total: 0,
				buyTotalShoppingCard: 0, //实际付款课程赠送购物卡总面值
				coupon: null,
				useCoupon: false,
				shareCustomerId: 0,
				sexchoice:false,
				
				name:'',
				phone:'',
				sexlist:[
					{
						sex:'男',
						choice:false,
					},
					{
						sex:'女',
						choice:false,
					},
				],
				noopt:'https://tool.tuanhaoke.cn/static/image/member/manage-active_icon_normal.png',
				opt:'https://tool.tuanhaoke.cn/static/image/member/manage-active_icon_selected.png',
				flag:false,
			}
		},
		filters: {
			goodName_val(value) {
				if (!value) return ''
				if (value.length > 40) {
					return value.slice(0, 40) + '...'
				}
				return value
			},
			goodName(value) {
				if (!value) return ''
				if (value.length > 38) {
					return value.slice(0, 38) + '...'
				}
				return value
			}
		},
		onLoad(option) {
			console.log(option)
			let store_id = parseInt(option.store_id, 10);
			if (!store_id > 0) {
				store_id = uni.getStorageSync('store_id')
			} else {
				uni.setStorageSync('store_id', store_id)
			}
			this.store_id = store_id
			this.$store.commit('updateStoreId', store_id)
		
			this.item = uni.getStorageSync('buyActCouse')
		
			console.log(this.item, '提交订单活动详情')
		
			this.isGroup = option.is_group //discount：优惠活动；group:团购活动
			this.priceType = option.special //group_purchase_price：团购价、special_price:优惠价
			if (option.special == 'group_purchase_price') {
				this.group_type = option.group_type //other_group:参团、alone_group:单独开团
			}
		
		
			if (option.special == 'group_purchase_price' && option.group_type == 'other_group') {
				this.buyMethod = 2
			} else if (option.special == 'group_purchase_price' && option.group_type == 'alone_group') {
				this.buyMethod = 3
			} else {
				this.buyMethod = 1
			}
		
			console.log(this.item.main_order_id || (parseInt(option.order_id, 0) > 0 ? parseInt(option.order_id, 0) : 0),
				'MMMMMMMMMMMMMMMMMMMMMMMMM');
			this.order_id = this.item.main_order_id || (parseInt(option.order_id, 0) > 0 ? parseInt(option.order_id, 0) : 0);
		
			let shareCustomerId = uni.getStorageSync('share_id')
			//判断是否有分享用户
			if(option.customer_id !=''){
				shareCustomerId = parseInt(option.customer_id)
			}
			if (parseInt(shareCustomerId, 10) > 0) {
				this.shareCustomerId = shareCustomerId
			}
			this.shareCustomerId = uni.getStorageSync('share_id')
			console.log(this.shareCustomerId, '分享者customer_id')
			// 处理数据
			this.init()
			this.getFormMsg()
			//获取该用户优惠券信息
			// this.getOptimalCoupon()
		
		},
		methods: {
			init() {
			
				//如果没有登录，去登录
				if (!this.token) {
			
					// uni.redirectTo({
					// 	url:'/pages/home/home?store_id='+this.store_id
					// })
				}
			
				// 如果购物车没有课程数据
				if (!this.item || !this.item.course_msg) {
					uni.redirectTo({
						url: '/pages/home/home?store_id=' + this.store_id
					})
				}
			
				let selectCourses = []
				let selectQuantity = 0
			
				//处理课程数据,将购买的所有课程列出
				for (let i = 0; i < this.item.course_msg.length; i++) {
			
					let course = this.item.course_msg[i]
					if (course.courseNum > 0) {
			
						selectQuantity = selectQuantity + course.courseNum
			
						// let totalPrice = course.courseNum*(Math.floor(parseFloat(course.special_price) * 100) / 100)
						let price = Math.floor(parseFloat(course.special_price) * 100) / 100
						if (this.isGroup == 'group' && this.priceType == 'group_purchase_price') {
			
							// totalPrice = course.courseNum*(Math.floor(parseFloat(course.group_purchase_price) * 100) / 100)
							price = Math.floor(parseFloat(course.group_purchase_price) * 100) / 100
						}
			
						selectCourses.push({
							activity_course_id: course.activity_course_id,
							name: course.name,
							image: course.image,
							price,
							quantity: course.courseNum,
							cash_shopping_card_amount: course.cash_shopping_card_amount,
						})
					}
			
				}
			
				console.log(selectCourses, 'selectCourses');
			
				// if(selectCourses.length === 0){
				// 	uni.redirectTo({
				// 		url:'/pages/home/home?store_id='+this.store_id
				// 	})
				// }
			
				this.selectCourses = selectCourses
			
				let buyCourses = []
				let giveCourses = []
			
				//如果设置了买x送y
				if (this.item.enable_purchase_course_then_give_course && selectQuantity > this.item.purchase_course) {
			
					//计算赠送数量
					let giveQuantity = Math.floor(selectQuantity / (this.item.purchase_course + this.item.give_course)) * this.item.give_course
					console.log(giveQuantity, '手机赠送数量giveQuantity');
					console.log('活动买' + this.item.purchase_course + '赠' + this.item.give_course)
			
					if (giveQuantity > 0) {
			
						//将购买的课程按照价格排序
						// console.log(buyCourses,'buyCourses排序前')
						selectCourses.sort(function(course1, course2) {
			
							if (course1.price < course2.price) {
			
								return -1
			
							} else if (course1.price > course2.price) {
			
								return 1
			
							} else {
			
								return 0
							}
						})
			
						for (let i = 0; i < selectCourses.length; i++) {
			
							if (giveQuantity === 0) {
			
								buyCourses.push({
									activity_course_id: selectCourses[i].activity_course_id,
									name: selectCourses[i].name,
									image: selectCourses[i].image,
									price: selectCourses[i].price,
									quantity: selectCourses[i].quantity,
									cash_shopping_card_amount: selectCourses[i].cash_shopping_card_amount,
								})
								continue
							}
			
							console.log(typeof selectCourses[i].quantity, 'typeof selectCourses[i].quantity')
							console.log(selectCourses[i].quantity, 'selectCourses[i].quantity')
			
							console.log(typeof giveQuantity, 'typeof giveQuantity')
							console.log(giveQuantity, 'giveQuantity')
			
							if (selectCourses[i].quantity > giveQuantity) {
			
								giveCourses.push({
									activity_course_id: selectCourses[i].activity_course_id,
									name: selectCourses[i].name,
									image: selectCourses[i].image,
									price: selectCourses[i].price,
									quantity: giveQuantity,
									cash_shopping_card_amount: selectCourses[i].cash_shopping_card_amount,
								})
			
								buyCourses.push({
									activity_course_id: selectCourses[i].activity_course_id,
									name: selectCourses[i].name,
									image: selectCourses[i].image,
									price: selectCourses[i].price,
									quantity: selectCourses[i].quantity - giveQuantity,
									cash_shopping_card_amount: selectCourses[i].cash_shopping_card_amount,
								})
			
								giveQuantity = 0
			
							} else if (selectCourses[i].quantity < giveQuantity) {
			
								giveCourses.push({
									activity_course_id: selectCourses[i].activity_course_id,
									name: selectCourses[i].name,
									image: selectCourses[i].image,
									price: selectCourses[i].price,
									quantity: selectCourses[i].quantity,
									cash_shopping_card_amount: selectCourses[i].cash_shopping_card_amount,
								})
			
								giveQuantity = giveQuantity - selectCourses[i].quantity
			
							} else {
			
								giveCourses.push({
									activity_course_id: selectCourses[i].activity_course_id,
									name: selectCourses[i].name,
									image: selectCourses[i].image,
									price: selectCourses[i].price,
									quantity: giveQuantity,
									cash_shopping_card_amount: selectCourses[i].cash_shopping_card_amount,
								})
			
								giveQuantity = 0
							}
			
						}
			
					} else {
			
						buyCourses = selectCourses
					}
			
				} else {
			
					buyCourses = selectCourses
				}
			
			
				//计算购买课程总价，赠送课程总价
				if (buyCourses.length > 0) {
			
					for (let i = 0; i < buyCourses.length; i++) {
			
						this.buyTotal = Math.floor(parseFloat(this.buyTotal + buyCourses[i].quantity * buyCourses[i].price) * 100) / 100;
						this.buyTotalShoppingCard = this.buyTotalShoppingCard + buyCourses[i].quantity * buyCourses[i].cash_shopping_card_amount;
					}
				}
			
				if (giveCourses.length > 0) {
					for (let i = 0; i < giveCourses.length; i++) {
						this.giveTotal = this.giveTotal + giveCourses[i].quantity * giveCourses[i].price;
					}
				}
			
				this.total = this.buyTotal
			
				this.buyCourses = buyCourses
				this.giveCourses = giveCourses
			
			},
			//	性别选择
			checksex(){
				if( this.sexlist[0].choice == false ){
					this.sexlist[0].choice = true
					this.sexlist[1].choice = false
				}else{
					this.sexlist[0].choice = false
					this.sexlist[1].choice = true
				}
			},
			// gainData(){
			// 	let data = {
			// 		token:this.$store.getters.getToken,
			// 		order_id:this.acOrderId
			// 	}
			// 	this.$api.gain_order_act_detail(data).then(res => {
			// 		console.log("gain_order_act_detail",res)
			// 		if(res.status){
			// 			this.courseDetail = res.data
			// 			this.getFormMsg(this.courseDetail.activity.activity_id)
						
			// 		}
			// 	}).catch(err => {
			// 		console.log(err)
			// 	})
			// },
			// 获取要添加的字段信息
			getFormMsg(){
				let data = {
					token:this.$store.getters.getToken,
					activity_id:this.item.activity_id
				}
				let that = this
				this.$api.together_order_msg(data).then(res => {
					console.log(res)
					if(res.status){
						that.form = res.res
						that.form.forEach(item => {
							item.value = ''
							if(item.name.required == 1){
								this.isNeed = true
							}
						})
						// that.courseDetail.activity_courses.forEach(item => {
						// 	item.forms =[]
						// 	for(let n=0;n<item.quantity;n++){
						// 		item.forms.push({})
						// 		let form_field=JSON.parse(JSON.stringify(that.form))
						// 		item.forms[n].form_field=form_field
						// 		item.forms[n].chooseAddreId = ''
						// 		item.forms[n].chooseAddreName = ''
						// 		item.forms[n].addreShow = false
						// 		this.gainCourseAddre(item.activity_course_id,item,n)
						// 	}							 
						// })
						that.courseDetail = res.res
						console.log("that.courseDetail.activity_courses");
					}else{
						uni.showToast({
							title:res.msg,
							icon:'none',
							duration:2000
						})
					}
				}).catch(err => {
					console.log(err)
				})
			},
			callPay(jsApiParameters) {
				if (typeof WeixinJSBridge == 'undefined') {
					if (document.addEventListener) {
						document.addEventListener('WeixinJSBridgeReady', this.jsApiCall, false);
					} else if (document.attachEvent) {
						document.attachEvent('WeixinJSBridgeReady', this.jsApiCall);
						document.attachEvent('onWeixinJSBridgeReady', this.jsApiCall);
					}
				} else {
					this.jsApiCallWX(jsApiParameters);
				}
			},
			jsApiCallWX(jsApiParameters) {
				let that = this;
				WeixinJSBridge.invoke('getBrandWCPayRequest', {
					"appId": jsApiParameters.appId,
					"nonceStr": jsApiParameters.nonceStr,
					"package": jsApiParameters.package,
					"paySign": jsApiParameters.paySign,
					"signType": jsApiParameters.signType,
					"timeStamp": jsApiParameters.timeStamp
				}, function(res) {
					console.log(jsApiParameters, 'WWWWWWWWWWWWWWWWWWWWWWW');
					console.log(res, 'WWWWWWWWWWWWWWWWWWWWWWW');
					WeixinJSBridge.log(res.err_msg);
					if (res.err_msg == 'get_brand_wcpay_request:ok') {
						uni.showToast({
							title: '支付成功',
							icon: 'none'
						});
						//可以进行查看订单，等操作%26
						// that.detail.group_url = that.detail.group_url.replace('&', '%26');
						// console.log(that.detail, 'DDDDDDDHHHHHHHHHHHHHHHHH');
						// uni.navigateTo({
						// 	url: './collectOrderInfo?detail=' + JSON.stringify(that.detail) + '&order_id=' + that.order_id
						// });
						uni.navigateTo({
							url:"joinGroup?store_id=" + that.store_id + '&order_id=' + that.acOrderId
						})
					} else {
						uni.showToast({
							title: '支付失败！',
							icon: 'none'
						});
					}
					// alert(res.err_code + res.err_desc + res.err_msg);
				});
			},
			// 验证信息
			verification(){
				let flag = true
				this.courseDetail.forEach(form_field=>{
					if(form_field.value == ''){
						uni.showToast({
							title:'必填信息不能为空',
							icon:'none',
							duration:2000
						})
						return flag = false
					}
				})
				return flag
			},
			// 付款
			handlePay() {
				const that = this
				this.telephone = this.telephone.trim()
				if (!((/^1(3|4|5|6|7|8|9)\d{9}$/).test(this.telephone)) || this.telephone == '') {
					uni.showToast({
						title: '手机号码有误，请重填',
						duration: 2000,
						icon: "none",
						position: "top",
						mask: true
					});
					return false
				}
				if(that.verification()){
					console.log(this.telephone, 'this.telephone');
					const data = {
						token: this.token,
						activity_id: this.item.activity_id,
						telephone: this.telephone,
						buy_method: this.buyMethod,
						coupon_id: this.useCoupon ? this.coupon.activity_coupon_id : 0,
						order_id: this.order_id, //团购邀请
						shared_customer_id: this.shareCustomerId,
						courses: JSON.stringify(this.selectCourses),
						course: JSON.stringify(this.courseDetail),
						// #ifdef H5
						in_type:'H5',
						// #endif
						// #ifdef MP-WEIXIN
						in_type:'min',
						// #endif
					}
					console.log(data,"+++++++++++++++++++++++++++++++++++++++++++++");
					this.$api.add_order(data).then(res => {
						console.log(res, 'add_order')
						if (res.status) {
							console.log('调取成功');
							const orderId = res.order_id 
							this.acOrderId = res.order_id
							let redirectUrl = '/pages/home/order/orderMsg?store_id=' + that.store_id + '&order_id=' + orderId
							uni.setStorageSync('redirectUrl', redirectUrl)
							// #ifdef H5
							if( res.type == 'min_pay' ){
								var payInfo = JSON.parse(res.data.res)
								console.log('orderAdd',payInfo,"微信支付");
								that.jsApiCall(that.$store.getters.getStoreId, orderId, payInfo)
							}else if( res.type == 'huifu_pay' ){
								var payInfo = res.data
								that.appid = res.appId
								console.log('orderAdd',payInfo,"汇付支付");
								that.jsApiCall(that.$store.getters.getStoreId, orderId, payInfo)
							}
								// if (res.actual_total > 0) {
								// 	if( true ){
								// 		// let payment = res.data.res;
								// 		// payment = JSON.parse(payment);
								// 		console.log(payment,"-----------------------------------------支付获取到的数据");
								// 		that.callPay(payment);
								// 	}else{
								// 		console.log('应付金额为' + res.actual_total + '，执行支付');
								// 		const data = JSON.parse(res.data)
								// 		console.log(data, 'DDDDDDDDDDDDDDDDD');
								// 		that.jsApiCall(that.store_id, orderId, JSON.parse(data.payInfo))
								// 	}
											
								// } else {
								// 	console.log('应付金额为0，执行跳转');
								// 	this.redirectUrl =  setStorageSync('redirectUrl', '/pages/home/order/joinGroup?store_id='+that.store_id+'&order_id='+orderId)
								// 	uni.redirectTo({
								// 		url: '/pages/home/order/joinGroup?store_id=' + that.store_id + '&order_id=' + orderId,
								// 		success: function(res) {
								// 			console.log(res, '跳转成功！')
								// 		},
								// 		fail: function(err) {
								// 			console.log(err, 'uni.redirectTo');
								// 		}
								// 	})
								// }
								
							// #endif
							// this.submitMsg()
							// #ifdef MP-WEIXIN
							if( res.type == 'min_pay' ){
								var payment = JSON.parse(res.data.res)
							}else if( res.type == 'huifu_pay' ){
								var payment = res.data
							}
								if (res.actual_total > 0) {
									console.log(payment,"支付获取到的数据");
									uni.requestPayment({
										provider: 'wxpay',
										timeStamp: payment.timeStamp,
										nonceStr: payment.nonceStr,
										package: payment.package,
										signType: payment.signType,
										paySign: payment.paySign,
										success: function(res) {
											uni.showToast({
												title: "支付成功",
												duration: 1000,
												icon: "none",
												mask: true
											})
											setTimeout(function() {
												uni.navigateTo({
													url: "joinGroup?order_id=" + that.acOrderId + '&store_id=' + that.store_id,
												})
											}, 1000)
										},
										fail: function(err) {
											console.log(JSON.stringify(err));
											uni.showToast({
												title: "支付失败",
												duration: 1000,
												icon: "none",
												mask: true
											})
											setTimeout(function() {
												uni.navigateBack({})
											}, 1000)
										}
									});
								} else {
									console.log('应付金额为0，执行跳转');
									this.redirectUrl =  setStorageSync('redirectUrl', '/pages/home/order/joinGroup?store_id='+that.store_id+'&order_id='+orderId)
									uni.redirectTo({
										url: '/pages/home/order/joinGroup?store_id=' + that.store_id + '&order_id=' + orderId,
										success: function(res) {
											console.log(res, '跳转成功！')
										},
										fail: function(err) {
											console.log(err, 'uni.redirectTo');
										}
									})
								}
							// #endif
						} else {
							uni.showToast({
								title: res.msg, //res.msg
								icon: 'none',
								duration: 2000
							})
						}
					}).catch(err => {
						uni.showToast({
							title: err.errMsg, //err.errMsg
							icon: 'none',
							duration: 2000
						})
					})
				}
			},
			// 调用微信JS api 支付
			jsApiCall(storeId, orderId, jsonWechat) {
				// alertMessage("调用微信JS api 支付"+JSON.stringify(jsonWechat));
				// alertMessage(jsonWechat+"===appId="+jsonWechat.appId+"===ss.paySign="+jsonWechat.paySign+"===ss.nonceStr="+jsonWechat.nonceStr+"===ss.signType"+jsonWechat.signType+"===ss.timeStamp"+jsonWechat.timeStamp+"===ss.package"+jsonWechat.package, 1);
				console.log(typeof jsonWechat, 'jsonWechat')
				console.log(jsonWechat.appId, 'jsonWechat.appId')
				if( this.appid != '' ){
					jsonWechat.appId = this.appid
				}
				WeixinJSBridge.invoke('getBrandWCPayRequest', {
					"appId": jsonWechat.appId,
					"nonceStr": jsonWechat.nonceStr,
					"package": jsonWechat.package,
					"paySign": jsonWechat.paySign,
					"signType": jsonWechat.signType,
					"timeStamp": jsonWechat.timeStamp
				}, function(res) {
					// alert(JSON.stringify(res));
					if (res.err_msg == "get_brand_wcpay_request:ok") {
						
						uni.navigateTo({
							url:"joinGroup?store_id=" + storeId + '&order_id=' + orderId
						})
			
					} else {
			
						uni.showToast({
							title: '支付失败',
							icon: 'none',
							duration: 2000
						})
					}
				});
			}
		}
	}
</script>

<style>
	.kpp-order-page{
		height: 100%;
		background-color: #ECECEC;
	}
	.kpp-order-msg {
		width: 100%;
		background: #FFFFFF;
		margin-top: 2upx;
		padding: 30upx;
		box-sizing: border-box;
	}

	.kpp-order-title {
		color: #333333;
		font-size: 34upx;
		padding-bottom: 30upx;
		box-sizing: border-box;
		border-bottom: 1upx solid #DEDEDE;
	}

	.kpp-order-phone-tip {
		color: #FF391F;
		font-size: 24upx;
		margin-top: 28upx;
	}

	.kpp-order-phone-input {
		width: 100%;
		height: 80upx;
		line-height: 80upx;
		margin-top: 30upx;
		border-radius: 4upx;
		background: #F5F5F5;
		display: flex;
	}

	.kpp-order-phone-input>view:nth-child(1) {
		height: 100%;
		width: 24%;
		background: #ECECEC;
		color: #333333;
		font-size: 28upx;
		text-align: center;
	}

	.kpp-order-phone-input>view>text {
		color: #FF391F;
		display: inline-block;
		margin-right: 6upx;
	}

	.kpp-order-phone-input>input {
		width: 70%;
		height: 100%;
		padding: 0 20upx;
		box-sizing: border-box;
		font-size: 28upx;
	}
	.kpp-course-msg{
		height: 70upx; 
		font-size: 30upx; 
		color: #333333; 
		font-weight: bold;
		line-height: 90upx;
		margin-left: 30upx;
	}
	.kpp-course-person-msg{
		margin-top: 20upx;
		background: #FFFFFF;
		padding: 30upx;
	}
	.kpp-course-person-msg-course{
		padding: 20upx 40upx;
		background: #FFFBFA;
		border: 1upx solid #FFE5E0;
		border-radius: 8upx;
		font-size: 30upx;
		color: #FF6C54;
	}
	.write-enroll-msg-title{
		display: flex;
		width: 100%;
		box-sizing: border-box;
		font-size: 30upx;
		background: #FFFFFF;
		margin-top: 20upx;
	}
	.write-enroll-msg-title>view:first-child{
		width: 8upx;
		height: 32upx;
		background: #FF8B46;
		margin-top: 6upx;
	}
	.write-enroll-msg-title>view:last-child{
		color: rgba(0,0,0,0.65);
		font-weight: bold;
		margin-left: 10upx;
	}
	.account-selection{
		display: inline-block; 
		background: #F5F5F5;
		font-size: 28upx; 
		margin-left: 50upx;
	}
	.account-selection :nth-child(1){
		width: 40upx; 
		height: 40upx;
		vertical-align: middle;
	}
	.account-selection :nth-child(2){
		display: inline-block;
		vertical-align: middle;
		margin: 0upx 10upx;
	}
	.kpp-order-footer{
		height: 64upx;
		margin-top: 20upx;
		font-size: 12px;
		line-height: 62upx;
		background: #FFEFAE;
		color: rgba(0,0,0,0.65);
		letter-spacing: 0;
		text-align: center;
	}
	.immediate-payment{
		position: absolute;
		display: inline-block;
		margin-top: -15upx;
		right: 20upx;
		width: 332upx;
		height: 80upx;
		line-height: 80upx;
		background: linear-gradient(to right,#FE9543,#FF664F);
		box-shadow: 0 4upx 12upx 0 rgba(250, 176, 48, 0.55);
		border-radius: 	44upx;
		color: #FFFFFF;
		font-size: 28upx;
		text-align: center;
	}
</style>
